package com.youdo.utils {
	public class URLUtils {

		public static function isHTTP(_url : String) : Boolean {
			if (_url == null) {
				return false;
			}
			//
			return _url.toLocaleLowerCase().indexOf( "http:" ) == 0;
		}

		public static function getDomain(url : String) : String {
			if (url == null) {
				return null;
			}

			var tmpURL : String = url;
			if (tmpURL.lastIndexOf( "/" ) > 8) {
				tmpURL = tmpURL.substr( 0, tmpURL.indexOf( "/", 8 ) );
				if (tmpURL.indexOf( "/" ) > -1) {
					tmpURL = tmpURL.substr( (tmpURL.lastIndexOf( "/" ) + 1) );
				}
			}
			return tmpURL;
		}
	}
}
